/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __DAC60508_H__
#define __DAC60508_H__

/* Includes ------------------------------------------------------------------ */
#include "stm32_spi.h"


/* DAC60508 ID */
#define DAC60508Z_ID        0x2816
#define DAC60508M_ID        0x2896


/* DAC60508操作 */
#define DAC60508_READ         0x80
#define DAC60508_WRITE        0x00


/* DAC60508寄存器 */
#define DAC60508_REG_NOP      0x00
#define DAC60508_REG_ID       0x01
#define DAC60508_REG_SYNC     0x02
#define DAC60508_REG_CONFIG   0x03
#define DAC60508_REG_GAIN     0x04
#define DAC60508_REG_TRIGGER  0x05
#define DAC60508_REG_BRDCAST  0x06
#define DAC60508_REG_STATUS   0x07
#define DAC60508_REG_C0       0x08
#define DAC60508_REG_C1       0x09
#define DAC60508_REG_C2       0x0A
#define DAC60508_REG_C3       0x0B
#define DAC60508_REG_C4       0x0C
#define DAC60508_REG_C5       0x0D
#define DAC60508_REG_C6       0x0E
#define DAC60508_REG_C7       0x0F


int32_t DAC60508_Init(void);
int32_t DAC60508_SetVal(uint8_t Reg, uint16_t Value);
uint16_t DAC60508_GetVal(uint8_t Reg);

#endif


